import React from 'react'
import ListTitle from '../../../components/SystemPrivileges/ListTitle'
import RoleList from '../../../components/SystemPrivileges/RoleList'
import { Space } from 'antd'
import { Link } from 'react-router-dom'
import { useSelector } from 'react-redux'
import Bread from '../../../components/Bread'


// 表头
const columns = [{
    title: '角色名称',
    dataIndex: 'role_name',
},
{
    title: '角色描述',
    dataIndex: 'role_des',
},
{
    title: '添加时间',
    dataIndex: 'role_add_time',
},
{
    title: '操作',
    key: 'action',
    render: (text, record) => (
        <Space>
            <Link to={{
                pathname: '/home/afterloan/addwarning',
                loanafter_warning_id: record.loanafter_warning_id,
            }}>权限设置</Link>
            <a>编辑</a>
            <a>删除</a>
        </Space>
    )
}]

export default function RoleManage() {
    const roleList = useSelector(state => state.systemRoleStore.roleList)
    return (
        <div className='role-manage'>
            <Bread bread_title1="系统权限" bread_title2="角色管理" />
            <ListTitle />
            <RoleList columns={columns} data={roleList || []} />
        </div>
    )
}
